using System.Collections;
using System.Collections.Generic;
using UnityEngine;

[CreateAssetMenu(fileName = "New Flask Effect", menuName = "Data/FlaskEffect/FireAttack")]
public class FireAttackFlaskItemEffect : FlaskItemEffect
{
    public override void FlaskUse()
    {
        base.FlaskUse();
        PlayerManager.instance.player.OnEachAttackDamage += FireAttack;
    }

    public override float FlaskUpdate()
    {
        return base.FlaskUpdate();
    }

    public override float FlaskEnd()
    {
        PlayerManager.instance.player.OnEachAttackDamage -= FireAttack;
        return base.FlaskEnd();
    }

    public void FireAttack(Enemy enemy)
    {
        PlayerStats playerStats = PlayerManager.instance.player.GetComponent<PlayerStats>();
        playerStats.DoMagicalDamage(enemy.GetComponent<EnemyStat>(),
            DamageType.FireDamage,
            x => x + 5, false);
    }
}
